#include <iostream>
#include <cstring>
using namespace std;

namespace MyString
{
    class string 
    {
    public:
        string(const char* str = "")
        {
            _size = strlen(str);
            _capacity = _size;
            _str = new char[_capacity + 1];
            strcpy(_str, str);
        }

        ~string()
        {
            delete[] _str;
            _str = nullptr;
            _size = _capacity = 0;
        }

        char* c_str()
        {
            return _str;
        }

    private:
        char* _str;
        size_t _size;
        size_t _capacity;
    };


    void test1()
    {
        string s1("Exponential Life\n");
        cout << s1.c_str() << endl;
    }
}


int main()
{
    MyString::test1();
    return 0;
}
